<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="castleContent.User"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<script type="text/javascript" src="jquery-2.1.1.js"></script>

<style>
div {
	float: left;
	text-align: center;
}
</style>

<script>
	 function createSoldier() {
		$.get(
				"http://localhost:8080/gameDevelopmentNew/CreateSoldierServlet", function(data) {
					$("#Resources").html(data);
				});
	}

	function createArcher(){
		$.get(
				"http://localhost:8080/gameDevelopmentNew/CreateArcherServlet", function(data) {
					$("#Resources").html(data);
				});
		}
	function createKnigh(){
		$.get(
				"http://localhost:8080/gameDevelopmentNew/CreateKnightServlet", function(data) {
					$("#Resources").html(data);
				});
		}
</script>
</head>
<body>
	<%
		User userObject = (User) session.getAttribute("Object");
	%>
	<h1 id="Resources">	Gold : <%=userObject.getGold()%> Iron :	<%=userObject.getFood() %>	</h1>

	<div>
		<BUTTON onclick="createSoldier()">Warrior</BUTTON>
		<h5>100 gold</h5>
	</div>
	<div>
		<BUTTON onclick="createArcher()" id="">Archer</BUTTON>
		<h5>150 Gold</h5>
		<h5>50 Iron</h5>
	</div>
	<div>
		<BUTTON onclick="createKnigh()">Knight</BUTTON>
		<h5>100 Iron</h5>
		<h5>50 Gems</h5>
	</div>
	<div>
		<a href="ElvenCastle.jsp"><img src="Arrow.png" height="15%"
			width="20%" />
	</div>
</body>
</html>